Optimal. Leaf size=138 \[ \frac {a^2 \sin ^3(c+d x)}{3 d}+\frac {a b \sin ^4(c+d x)}{2 d}-\frac {\left (2 a^2-b^2\right ) \sin ^5(c+d x)}{5 d}-\frac {2 a b \sin ^6(c+d x)}{3 d}+\frac {\left (a^2-2 b^2\right ) \sin ^7(c+d x)}{7 d}+\frac {a b \sin ^8(c+d x)}{4 d}+\frac {b^2 \sin ^9(c+d x)}{9 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.12, antiderivative size = 138, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 3, integrand size = 29, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.103, Rules used = {2916, 12, 962}
\begin {gather*} \frac {\left (a^2-2 b^2\right ) \sin ^7(c+d x)}{7 d}-\frac {\left (2 a^2-b^2\right ) \sin ^5(c+d x)}{5 d}+\frac {a^2 \sin ^3(c+d x)}{3 d}+\frac {a b \sin ^8(c+d x)}{4 d}-\frac {2 a b \sin ^6(c+d x)}{3 d}+\frac {a b \sin ^4(c+d x)}{2 d}+\frac {b^2 \sin ^9(c+d x)}{9 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 962
Rule 2916
Rubi steps
\begin {align*} \int \cos ^5(c+d x) \sin ^2(c+d x) (a+b \sin (c+d x))^2 \, dx &=\frac {\text {Subst}\left (\int \frac {x^2 (a+x)^2 \left (b^2-x^2\right )^2}{b^2} \, dx,x,b \sin (c+d x)\right )}{b^5 d}\\ &=\frac {\text {Subst}\left (\int x^2 (a+x)^2 \left (b^2-x^2\right )^2 \, dx,x,b \sin (c+d x)\right )}{b^7 d}\\ &=\frac {\text {Subst}\left (\int \left (a^2 b^4 x^2+2 a b^4 x^3+b^2 \left (-2 a^2+b^2\right ) x^4-4 a b^2 x^5+\left (a^2-2 b^2\right ) x^6+2 a x^7+x^8\right ) \, dx,x,b \sin (c+d x)\right )}{b^7 d}\\ &=\frac {a^2 \sin ^3(c+d x)}{3 d}+\frac {a b \sin ^4(c+d x)}{2 d}-\frac {\left (2 a^2-b^2\right ) \sin ^5(c+d x)}{5 d}-\frac {2 a b \sin ^6(c+d x)}{3 d}+\frac {\left (a^2-2 b^2\right ) \sin ^7(c+d x)}{7 d}+\frac {a b \sin ^8(c+d x)}{4 d}+\frac {b^2 \sin ^9(c+d x)}{9 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.55, size = 169, normalized size = 1.22 \begin {gather*} \frac {-7560 a b \cos (2 (c+d x))-1260 a b \cos (4 (c+d x))+840 a b \cos (6 (c+d x))+315 a b \cos (8 (c+d x))+12600 a^2 \sin (c+d x)+3780 b^2 \sin (c+d x)-840 a^2 \sin (3 (c+d x))-840 b^2 \sin (3 (c+d x))-1512 a^2 \sin (5 (c+d x))-504 b^2 \sin (5 (c+d x))-360 a^2 \sin (7 (c+d x))+90 b^2 \sin (7 (c+d x))+70 b^2 \sin (9 (c+d x))}{161280 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.50, size = 155, normalized size = 1.12
method | result | size |
derivativedivides | \(\frac {a^{2} \left (-\frac {\sin \left (d x +c \right ) \left (\cos ^{6}\left (d x +c \right )\right )}{7}+\frac {\left (\frac {8}{3}+\cos ^{4}\left (d x +c \right )+\frac {4 \left (\cos ^{2}\left (d x +c \right )\right )}{3}\right ) \sin \left (d x +c \right )}{35}\right )+2 a b \left (-\frac {\left (\sin ^{2}\left (d x +c \right )\right ) \left (\cos ^{6}\left (d x +c \right )\right )}{8}-\frac {\left (\cos ^{6}\left (d x +c \right )\right )}{24}\right )+b^{2} \left (-\frac {\left (\sin ^{3}\left (d x +c \right )\right ) \left (\cos ^{6}\left (d x +c \right )\right )}{9}-\frac {\sin \left (d x +c \right ) \left (\cos ^{6}\left (d x +c \right )\right )}{21}+\frac {\left (\frac {8}{3}+\cos ^{4}\left (d x +c \right )+\frac {4 \left (\cos ^{2}\left (d x +c \right )\right )}{3}\right ) \sin \left (d x +c \right )}{105}\right )}{d}\) | \(155\) |
default | \(\frac {a^{2} \left (-\frac {\sin \left (d x +c \right ) \left (\cos ^{6}\left (d x +c \right )\right )}{7}+\frac {\left (\frac {8}{3}+\cos ^{4}\left (d x +c \right )+\frac {4 \left (\cos ^{2}\left (d x +c \right )\right )}{3}\right ) \sin \left (d x +c \right )}{35}\right )+2 a b \left (-\frac {\left (\sin ^{2}\left (d x +c \right )\right ) \left (\cos ^{6}\left (d x +c \right )\right )}{8}-\frac {\left (\cos ^{6}\left (d x +c \right )\right )}{24}\right )+b^{2} \left (-\frac {\left (\sin ^{3}\left (d x +c \right )\right ) \left (\cos ^{6}\left (d x +c \right )\right )}{9}-\frac {\sin \left (d x +c \right ) \left (\cos ^{6}\left (d x +c \right )\right )}{21}+\frac {\left (\frac {8}{3}+\cos ^{4}\left (d x +c \right )+\frac {4 \left (\cos ^{2}\left (d x +c \right )\right )}{3}\right ) \sin \left (d x +c \right )}{105}\right )}{d}\) | \(155\) |
risch | \(\frac {5 a^{2} \sin \left (d x +c \right )}{64 d}+\frac {3 b^{2} \sin \left (d x +c \right )}{128 d}+\frac {b^{2} \sin \left (9 d x +9 c \right )}{2304 d}+\frac {a b \cos \left (8 d x +8 c \right )}{512 d}-\frac {\sin \left (7 d x +7 c \right ) a^{2}}{448 d}+\frac {\sin \left (7 d x +7 c \right ) b^{2}}{1792 d}+\frac {a b \cos \left (6 d x +6 c \right )}{192 d}-\frac {3 a^{2} \sin \left (5 d x +5 c \right )}{320 d}-\frac {\sin \left (5 d x +5 c \right ) b^{2}}{320 d}-\frac {a b \cos \left (4 d x +4 c \right )}{128 d}-\frac {a^{2} \sin \left (3 d x +3 c \right )}{192 d}-\frac {\sin \left (3 d x +3 c \right ) b^{2}}{192 d}-\frac {3 a b \cos \left (2 d x +2 c \right )}{64 d}\) | \(213\) |
norman | \(\frac {\frac {8 a^{2} \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3 d}+\frac {8 a^{2} \left (\tan ^{15}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3 d}+\frac {16 \left (a^{2}+2 b^{2}\right ) \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{5 d}+\frac {16 \left (a^{2}+2 b^{2}\right ) \left (\tan ^{13}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{5 d}+\frac {8 \left (31 a^{2}-48 b^{2}\right ) \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{35 d}+\frac {8 \left (31 a^{2}-48 b^{2}\right ) \left (\tan ^{11}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{35 d}+\frac {32 \left (129 a^{2}+218 b^{2}\right ) \left (\tan ^{9}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{315 d}-\frac {8 a b \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3 d}-\frac {8 a b \left (\tan ^{12}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3 d}+\frac {8 a b \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}+\frac {8 a b \left (\tan ^{14}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}+\frac {16 a b \left (\tan ^{8}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}+\frac {16 a b \left (\tan ^{10}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{9}}\) | \(295\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.27, size = 108, normalized size = 0.78 \begin {gather*} \frac {140 \, b^{2} \sin \left (d x + c\right )^{9} + 315 \, a b \sin \left (d x + c\right )^{8} - 840 \, a b \sin \left (d x + c\right )^{6} + 180 \, {\left (a^{2} - 2 \, b^{2}\right )} \sin \left (d x + c\right )^{7} + 630 \, a b \sin \left (d x + c\right )^{4} - 252 \, {\left (2 \, a^{2} - b^{2}\right )} \sin \left (d x + c\right )^{5} + 420 \, a^{2} \sin \left (d x + c\right )^{3}}{1260 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.37, size = 121, normalized size = 0.88 \begin {gather*} \frac {315 \, a b \cos \left (d x + c\right )^{8} - 420 \, a b \cos \left (d x + c\right )^{6} + 4 \, {\left (35 \, b^{2} \cos \left (d x + c\right )^{8} - 5 \, {\left (9 \, a^{2} + 10 \, b^{2}\right )} \cos \left (d x + c\right )^{6} + 3 \, {\left (3 \, a^{2} + b^{2}\right )} \cos \left (d x + c\right )^{4} + 4 \, {\left (3 \, a^{2} + b^{2}\right )} \cos \left (d x + c\right )^{2} + 24 \, a^{2} + 8 \, b^{2}\right )} \sin \left (d x + c\right )}{1260 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 1.33, size = 190, normalized size = 1.38 \begin {gather*} \begin {cases} \frac {8 a^{2} \sin ^{7}{\left (c + d x \right )}}{105 d} + \frac {4 a^{2} \sin ^{5}{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{15 d} + \frac {a^{2} \sin ^{3}{\left (c + d x \right )} \cos ^{4}{\left (c + d x \right )}}{3 d} - \frac {a b \sin ^{2}{\left (c + d x \right )} \cos ^{6}{\left (c + d x \right )}}{3 d} - \frac {a b \cos ^{8}{\left (c + d x \right )}}{12 d} + \frac {8 b^{2} \sin ^{9}{\left (c + d x \right )}}{315 d} + \frac {4 b^{2} \sin ^{7}{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{35 d} + \frac {b^{2} \sin ^{5}{\left (c + d x \right )} \cos ^{4}{\left (c + d x \right )}}{5 d} & \text {for}\: d \neq 0 \\x \left (a + b \sin {\left (c \right )}\right )^{2} \sin ^{2}{\left (c \right )} \cos ^{5}{\left (c \right )} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.56, size = 173, normalized size = 1.25 \begin {gather*} \frac {a b \cos \left (8 \, d x + 8 \, c\right )}{512 \, d} + \frac {a b \cos \left (6 \, d x + 6 \, c\right )}{192 \, d} - \frac {a b \cos \left (4 \, d x + 4 \, c\right )}{128 \, d} - \frac {3 \, a b \cos \left (2 \, d x + 2 \, c\right )}{64 \, d} + \frac {b^{2} \sin \left (9 \, d x + 9 \, c\right )}{2304 \, d} - \frac {{\left (4 \, a^{2} - b^{2}\right )} \sin \left (7 \, d x + 7 \, c\right )}{1792 \, d} - \frac {{\left (3 \, a^{2} + b^{2}\right )} \sin \left (5 \, d x + 5 \, c\right )}{320 \, d} - \frac {{\left (a^{2} + b^{2}\right )} \sin \left (3 \, d x + 3 \, c\right )}{192 \, d} + \frac {{\left (10 \, a^{2} + 3 \, b^{2}\right )} \sin \left (d x + c\right )}{128 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 11.44, size = 108, normalized size = 0.78 \begin {gather*} \frac {{\sin \left (c+d\,x\right )}^7\,\left (\frac {a^2}{7}-\frac {2\,b^2}{7}\right )-{\sin \left (c+d\,x\right )}^5\,\left (\frac {2\,a^2}{5}-\frac {b^2}{5}\right )+\frac {a^2\,{\sin \left (c+d\,x\right )}^3}{3}+\frac {b^2\,{\sin \left (c+d\,x\right )}^9}{9}+\frac {a\,b\,{\sin \left (c+d\,x\right )}^4}{2}-\frac {2\,a\,b\,{\sin \left (c+d\,x\right )}^6}{3}+\frac {a\,b\,{\sin \left (c+d\,x\right )}^8}{4}}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________